Sign in to follow this  
Followers 0
Guest sydullasyed

can we read only the column of table using the readline()

20 posts in this topic

Hi,

in my script i want read only part of the line in text file(i.e. only sharename column)

the text file contains data as follows

sharename type comment

---------------------------------------------------

sc disk testshare

sc1 disk testshare1

is there any way to read only one column? :P

Share this post


Link to post
Share on other sites



HI,

maybe just :

#include <file.au3>
#include <Array.au3>
Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    $aRecords[$x] = _StringBetween1($aRecords[$x], 0, ' ')
Next

_ArrayDisplay($aRecords, "First Colum")

Func _StringBetween1($s_String, $s_Start = 0, $s_End = 0)
    $s_Start = StringInStr($s_String, $s_Start) + StringLen($s_Start)
    Return StringMid($s_String, $s_Start, StringInStr($s_String, $s_End) - $s_Start)
EndFunc   ;==>_StringBetween1

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

or

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

Global $firstC[UBound($aRecords)] = ['']
Global $SecondC[UBound($aRecords)] = ['']
Global $thirdC[UBound($aRecords)] = ['']


For $x = 1 to $aRecords[0]
    $array  = StringSplit($aRecords[$x], ' ')
    $firstC[$x] = $array[1]
    $SecondC[$x] = $array[2]
    $thirdC[$x] = $array[3]
Next

_ArrayDisplay($firstC, "1 Colum")
_ArrayDisplay($SecondC, "2 Colum")
_ArrayDisplay($thirdC, "3 Colum")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

or

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

Global $firstC[UBound($aRecords)] = ['']
Global $SecondC[UBound($aRecords)] = ['']
Global $thirdC[UBound($aRecords)] = ['']
For $x = 1 to $aRecords[0]
    $array  = StringSplit($aRecords[$x], ' ')
    $firstC[$x] = $array[1]
    $SecondC[$x] = $array[2]
    $thirdC[$x] = $array[3]
Next

_ArrayDisplay($firstC, "1 Colum")
_ArrayDisplay($SecondC, "2 Colum")
_ArrayDisplay($thirdC, "3 Colum")

So long,

Mega

Hi Mega,

Thank u for sending me the solution

my textfile (cases.txt) contains a table (having 3 columns) as follows

Share name Type Comment

------------------------------------------------------------------------------------------------

sc disk testshare

sc1 disk2 testshare2

Here i have to access only the "Sharename"

In the code which you have send i did not understand the lines

HI,

or

[autoit]

#include <file.au3>

#include <Array.au3>

Dim $aRecords

If Not _FileReadToArray("blank.txt",$aRecords) Then

MsgBox(4096,"Error", " Error reading log to Array error:" & @error)

Exit

EndIf

Global $firstC[uBound($aRecords)] = ['']

Global $SecondC[uBound($aRecords)] = ['']

Global $thirdC[uBound($aRecords)] = ['']

and

$array = StringSplit($aRecords[$x], ' ')

while i am running the the above code, it is giving the error saying ("Array variable has incorrect number of subscripts or subscript dimension range exceeded." )

Can you explain me the code? :P

Share this post


Link to post
Share on other sites

HI,

or

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

Global $firstC[UBound($aRecords)] = ['']
Global $SecondC[UBound($aRecords)] = ['']
Global $thirdC[UBound($aRecords)] = ['']
For $x = 1 to $aRecords[0]
    $array  = StringSplit($aRecords[$x], ' ')
    $firstC[$x] = $array[1]
    $SecondC[$x] = $array[2]
    $thirdC[$x] = $array[3]
Next

_ArrayDisplay($firstC, "1 Colum")
_ArrayDisplay($SecondC, "2 Colum")
_ArrayDisplay($thirdC, "3 Colum")

So long,

Mega

Hi Mega,

Thank u for sending me the solution

my textfile (cases.txt) contains a table (having 3 columns) as follows

Share name Type Comment

------------------------------------------------------------------------------------------------

sc disk testshare

sc1 disk2 testshare2

Here i have to access only the "Sharename"

In the code which you have send i did not understand the lines

HI,

or

[autoit]

#include <file.au3>

#include <Array.au3>

Dim $aRecords

If Not _FileReadToArray("blank.txt",$aRecords) Then

MsgBox(4096,"Error", " Error reading log to Array error:" & @error)

Exit

EndIf

Global $firstC[uBound($aRecords)] = ['']

Global $SecondC[uBound($aRecords)] = ['']

Global $thirdC[uBound($aRecords)] = ['']

and

$array = StringSplit($aRecords[$x], ' ')

while i am running the the above code, it is giving the error saying ("Array variable has incorrect number of subscripts or subscript dimension range exceeded." )

Can you explain me the code? :P

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi

it works if you add 2 lines after filread; [You have 4 columns in your title, and only 3 columns of data]

[Mega has put each line into an arra of strings , and then split each line with the space between columns;;]

EndIf
$aRecords[1]=StringReplace($aRecords[1],"Share name","Share_name")  ; can't have a space in sharename, else too many columns on that line
_ArrayDelete($aRecords,2)                                           ; delete "---------------------" line
Global $firstC[UBound($aRecords)] = ['']
Best, Randall Edited by randallc

Share this post


Link to post
Share on other sites

Hi

it works if you add 2 lines after filread; [You have 4 columns in your title, and only 3 columns of data]

[Mega has put each line into an arra of strings , and then split each line with the space between columns;;]

EndIf
$aRecords[1]=StringReplace($aRecords[1],"Share name","Share_name")  ; can't have a space in sharename, else too many columns on that line
_ArrayDelete($aRecords,2)                                           ; delete "---------------------" line
Global $firstC[UBound($aRecords)] = ['']
Best, Randall

Hi Randall,

it is giving the error by adding the two lines.The error is as aollows

((Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$thirdC[$x] = $array[3]

$thirdC[$x] = ^ ERROR ))

my code is as follows

#include <file.au3>

#include <Array.au3>

Dim $aRecords

If Not _FileReadToArray("cases.txt",$aRecords) Then

MsgBox(4096,"Error", " Error reading log to Array error:" & @error)

Exit

EndIf

$aRecords[1]=StringReplace($aRecords[1],"sharename","sharename")

_ArrayDelete($aRecords,2)

Global $firstC[uBound($aRecords)] = ['']

Global $SecondC[uBound($aRecords)] = ['']

Global $thirdC[uBound($aRecords)] = ['']

For $x = 1 to $aRecords[0]

$array = StringSplit($aRecords[$x], ' ')

$firstC[$x] = $array[1]

$SecondC[$x] = $array[2]

$thirdC[$x] = $array[3]

Next

_ArrayDisplay($firstC, "1 Colum")

_ArrayDisplay($SecondC, "2 Colum")

_ArrayDisplay($thirdC, "3 Colum")

and i am attaching the text file also ....

cases.txt

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Hi,

As in limbo,; ; prefer StringregExpReplace, but "in limbo"

this works on your test file [281 bytes version]; using "Array2d.au3" from my signature link;

;csvsplit2d.au3
#include "Array2d.au3"
Dim $aRecords
_FileReadToArray("cases.txt",$aRecords)
_ArrayDelete($aRecords,0)   ; get to base zero
for $x= 0 to UBound($aRecords)-1
    $aRecords[$x]=StringReplace(StringStripWS(StringReplace($aRecords[$x],@TAB," "),7)," ","|")
Next
$TwoDimArr=_Array2DCreateFromArraySt($aRecords)
for $i= 0 to UBound($TwoDimArr,2)-1 
    MsgBox(0,"","Column "&$i&"="&_Array2DTo1String( $TwoDimArr, $i, "", 0 ,0))
Next
Randall Edited by randallc

Share this post


Link to post
Share on other sites

Hi,

Yes; you have not just 1 space between the columns; and you keep changing it!

Where is your original 2nd line?....

You'll need to do a "replace with regexp" for the whitespace..

help!

Randall

Hi Randall

i am not getting you.Can you explain mebriefly?

i am attaching the filewith the second line...... you have mentioned

i did not understand the line $aRecords[1]=StringReplace($aRecords[1],"Share name","Share_name")

here i have given the column name as sharename but you mentioned share_name

Can you explain me?

Share this post


Link to post
Share on other sites

HI,

does this help?

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

_ArrayDisplay($aRecords, "File")
Global $firstC[UBound($aRecords)] = ['']

For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], ' ') = 0 Then
        $firstC[$x]  = $aRecords[$x]
    Else
    $firstC[$x]  = StringLeft($aRecords[$x], StringInStr(StringStripWS($aRecords[$x], 4), ' ')-1)
EndIf
Next

_ArrayDisplay($firstC, "1 Colum")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

does this help?

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

_ArrayDisplay($aRecords, "File")
Global $firstC[UBound($aRecords)] = ['']

For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], ' ') = 0 Then
        $firstC[$x]  = $aRecords[$x]
    Else
    $firstC[$x]  = StringLeft($aRecords[$x], StringInStr(StringStripWS($aRecords[$x], 4), ' ')-1)
EndIf
Next

_ArrayDisplay($firstC, "1 Colum")

So long,

Mega

Hi Mega ,

It is working fine but in o/p it is displaying as [0]= (i am sending the o/p attachment)

we haven't given that format but it is printing like that

if i want to capture the Data of the column (i.e. sc)and i want to print it in to the text file.

while i try for this it is copying the field name also(i.e.sharename)

i need only the data

if you have any idea please assist me

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

HI,

that should be easy. Try this:

#include <file.au3>
#include <Array.au3>

Dim $aRecords
If Not _FileReadToArray("blank.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

_ArrayDisplay($aRecords, "File") ; <--  you don't need this
Global $firstC[UBound($aRecords)] = ['']

For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], ' ') = 0 Then
        $firstC[$x]  = $aRecords[$x]
    Else
    $firstC[$x]  = StringLeft($aRecords[$x], StringInStr(StringStripWS($aRecords[$x], 4), ' ')-1)
EndIf
Next
_ArrayDisplay($firstC, "1 Colum")  ; <--  you don't need this
_FileWriteFromArray("Sharenames.txt", $firstC, 3)

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hi,

I guess you didn't like my "Array2D.au3" UDF? [post #9]

Oh well, here it is with "ordinary" 2Darray;

;csvsplit2da.au3
#include <file.au3>
Dim $aRecords,$ColumnStrings
_FileReadToArray("cases.txt",$aRecords)
Dim $aColumnStrings[3], $a2D_Records[UBound($aRecords)-2][3]
for $x= 2 to UBound($aRecords)-1; miss count [0] and header row [1]
    $aRecords[$x]=StringStripWS(StringReplace($aRecords[$x],@TAB," "),7)
    If StringInStr($aRecords[$x], ' ') <> 0 Then
        $a2D_RecordsTemp=StringSplit($aRecords[$x]," ")
        for $y= 1 to UBound($a2D_RecordsTemp)-1
            $a2D_Records[$x-2 ][$y-1]=$a2D_RecordsTemp[$y]
        Next
    EndIf
Next
For $y = 0 to 2
    For $x = 0 to UBound($a2D_Records)-1
        $aColumnStrings[$y]&=" "&$a2D_Records[$x][$y]
    Next
    $ColumnStrings&=$aColumnStrings[$y]&@LF
Next
FileWrite("answerfile.txt",$ColumnStrings)
MsgBox(0,"","$aColumnStrings="&@LF&$ColumnStrings)
Randall Edited by randallc

Share this post


Link to post
Share on other sites

Hi,

I guess you didn't like my "Array2D.au3" UDF? [post #9]

Oh well, here it is with "ordinary" 2Darray;

;csvsplit2da.au3
#include <file.au3>
Dim $aRecords,$ColumnStrings
_FileReadToArray("cases.txt",$aRecords)
Dim $aColumnStrings[3], $a2D_Records[UBound($aRecords)-2][3]
for $x= 2 to UBound($aRecords)-1; miss count [0] and header row [1]
    $aRecords[$x]=StringStripWS(StringReplace($aRecords[$x],@TAB," "),7)
    If StringInStr($aRecords[$x], ' ') <> 0 Then
        $a2D_RecordsTemp=StringSplit($aRecords[$x]," ")
        for $y= 1 to UBound($a2D_RecordsTemp)-1
            $a2D_Records[$x-2 ][$y-1]=$a2D_RecordsTemp[$y]
        Next
    EndIf
Next
For $y = 0 to 2
    For $x = 0 to UBound($a2D_Records)-1
        $aColumnStrings[$y]&=" "&$a2D_Records[$x][$y]
    Next
    $ColumnStrings&=$aColumnStrings[$y]&@LF
Next
FileWrite("answerfile.txt",$ColumnStrings)
MsgBox(0,"","$aColumnStrings="&@LF&$ColumnStrings)
Randall

Hi Randall ,

Its working fine

But it is giving the o/p as sc sc1 sc2 sc3

But i need the o/p as

sc

sc1

sc2

sc3

so that i can check the names line by line if they exist in the txt file or not(i need this for checking purpose.

i will give the sharename then i need to check either it exists or not)

i have changed the code silghtly

as follows

still it is giving the same o/p

#include <file.au3>

Dim $aRecords,$ColumnStrings

_FileReadToArray("cases.txt",$aRecords)

Dim $aColumnStrings[3], $a2D_Records[uBound($aRecords)-2][3]

for $x= 2 to UBound($aRecords)-1; miss count [0] and header row [1]

$aRecords[$x]=StringStripWS(StringReplace($aRecords[$x],@TAB," "),7)

If StringInStr($aRecords[$x], ' ') <> 0 Then

$a2D_RecordsTemp=StringSplit($aRecords[$x]," ")

for $y= 1 to UBound($a2D_RecordsTemp)-1

$a2D_Records[$x-2 ][$y-1]=$a2D_RecordsTemp[$y]

Next

EndIf

Next

For $y = 0 to 0

For $x = 0 to UBound($a2D_Records)-1

$aColumnStrings[$y]&=" "&$a2D_Records[$x][$y]

Next

$ColumnStrings&=$aColumnStrings[$y]&@LF

Next

FileWriteLine("Sharenames.txt",$ColumnStrings)

MsgBox(0,"","$aColumnStrings="&@LF&$ColumnStrings)

====================================================

Share this post


Link to post
Share on other sites

Hi Mega ,

It is working fine but in o/p it is displaying as [0]= (i am sending the o/p attachment)

we haven't given that format but it is printing like that

if i want to capture the Data of the column (i.e. sc)and i want to print it in to the text file.

while i try for this it is copying the field name also(i.e.sharename)

i need only the data

if you have any idea please assist me

Hi,

if you are not using _ArrayDisplay, despite using any function like FileWriteFromArray, it will not write the [0]= and so on into the file! ONLY the data.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I guess you could change the line between the "nexts" near the end;

$aColumnStrings[$y]&=@LF&$a2D_Records[$x][$y]
; depends what you are then going to do with it;

Best, Randall

Hi,

i executed my script it is giving the o/p as sc sc1sc2 sc3

But i need the o/p as

sc

sc1

sc2

sc3

i have used the writeline also but it is giving the same o/p

with this i have to check whether the share name exixts on not

Prior to this see i am running the "net view \\ "command from this i will get a o/p

as follows

==================================================

Shared resources at \\sydsye

XXXX

Share name Type Used as Comment

-------------------------------------------------------------------------------

sc Disk

testshare Disk testshare

The command completed successfully.

===================================================

i am sending this o/p to txt file

since all the o/p is present in txt file i am facing the problem in checking the existance os share name so i want to send only the share names to other text file so that i can easily check the existance of share name

i am facing the problem in sending only the sharenames to other txt file

or is there any way ?

Please assist me

Share this post


Link to post
Share on other sites

Sorry,

in notepad, it appears they are all on the same line, although ther are actually "linefeeds" between; so use @crlf.

Then any output, in array or textfile should look OK.

How are you going to compare?

$aColumnStrings[$y]&=@crLF&$a2D_Records[$x][$y]oÝ÷ Ù«­¢+ØíÍÙÍÁ±¥ÐɹÔÌì(¥¹±Õ±Ðí¥±¹ÔÌÐì(¥¹±Õ±ÐíÉÉä¹ÔÌÐì)¥´ÀÌØíI½ÉÌ°ÀÌØí
½±Õµ¹MÑÉ¥¹Ì°ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì)}¥±IQ½ÉÉä ÅÕ½ÐíÍ̹ÑáÐÅÕ½Ðì°ÀÌØíI½É̤)¥´ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÍt°ÀÌØíÉ}I½ÉÍmU ½Õ¹ ÀÌØíI½É̤´ÉulÍt)½ÈÀÌØíàôÈѼU   ½Õ¹ ÀÌØíI½É̤´Äìµ¥Í̽չÐlÁt¹¡ÈɽÜlÅt($ÀÌØíI½ÉÍlÀÌØíátõMÑÉ¥¹MÑÉ¥Á]L¡MÑÉ¥¹IÁ± ÀÌØíI½ÉÍlÀÌØíát±Q°ÅÕ½ÐìÅÕ½Ð줰ܤ(%%MÑÉ¥¹%¹MÑÈ ÀÌØíI½ÉÍlÀÌØíát°ÌäìÌä줱ÐìÐìÀQ¡¸($$ÀÌØíÉ}I½ÉÍQµÀõMÑÉ¥¹MÁ±¥Ð ÀÌØíI½ÉÍlÀÌØíát°ÅÕ½ÐìÅÕ½Ðì¤($%½ÈÀÌØíäôÄѼU ½Õ¹ ÀÌØíÉ}I½ÉÍQµÀ¤´Ä($$$ÀÌØíÉ}I½ÉÍlÀÌØíà´ÈulÀÌØíä´ÅtôÀÌØíÉ}I½ÉÍQµÁlÀÌØíåt($%9áÐ(%¹%)9áÐ)½ÈÀÌØíäôÀѼÈ(%¥±±Ñ ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì¤(%½ÈÀÌØíàôÀѼU  ½Õ¹ ÀÌØíÉ}I½É̤´Ä($$ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåtµÀìõÉ1µÀìÀÌØíÉ}I½ÉÍlÀÌØíáulÀÌØíåt(%9áÐ(%5Í    ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½ÐítôÅÕ½ÐìµÀí1µÀìÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåt¤(%¥±]É¥Ñ ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì°ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåt¤(%}¥±IQ½ÉÉä ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì°ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì¤(%}ÉÉå¥ÍÁ±ä ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì°ÅÕ½ÐìÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹ÌÅÕ½ÐìµÀìÀÌØíä¤(%ÉչݥРÅÕ½Ðí¹½ÑÁÅÕ½ÐìµÀìÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì¤($ÀÌØí
½±Õµ¹MÑÉ¥¹ÌµÀìôÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåtµÀí1)9áÐ(íø5Í  ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÀÌØí
½±Õµ¹MÑÉ¥¹ÌôÅÕ½ÐìµÀí1µÀìÀÌØí
½±Õµ¹MÑÉ¥¹Ì¤(

Share this post


Link to post
Share on other sites

Sorry,

in notepad, it appears they are all on the same line, although ther are actually "linefeeds" between; so use @crlf.

Then any output, in array or textfile should look OK.

How are you going to compare?

$aColumnStrings[$y]&=@crLF&$a2D_Records[$x][$y]oÝ÷ Ù«­¢+ØíÍÙÍÁ±¥ÐɹÔÌì(¥¹±Õ±Ðí¥±¹ÔÌÐì(¥¹±Õ±ÐíÉÉä¹ÔÌÐì)¥´ÀÌØíI½ÉÌ°ÀÌØí
½±Õµ¹MÑÉ¥¹Ì°ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì)}¥±IQ½ÉÉä ÅÕ½ÐíÍ̹ÑáÐÅÕ½Ðì°ÀÌØíI½É̤)¥´ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÍt°ÀÌØíÉ}I½ÉÍmU ½Õ¹ ÀÌØíI½É̤´ÉulÍt)½ÈÀÌØíàôÈѼU   ½Õ¹ ÀÌØíI½É̤´Äìµ¥Í̽չÐlÁt¹¡ÈɽÜlÅt($ÀÌØíI½ÉÍlÀÌØíátõMÑÉ¥¹MÑÉ¥Á]L¡MÑÉ¥¹IÁ± ÀÌØíI½ÉÍlÀÌØíát±Q°ÅÕ½ÐìÅÕ½Ð줰ܤ(%%MÑÉ¥¹%¹MÑÈ ÀÌØíI½ÉÍlÀÌØíát°ÌäìÌä줱ÐìÐìÀQ¡¸($$ÀÌØíÉ}I½ÉÍQµÀõMÑÉ¥¹MÁ±¥Ð ÀÌØíI½ÉÍlÀÌØíát°ÅÕ½ÐìÅÕ½Ðì¤($%½ÈÀÌØíäôÄѼU ½Õ¹ ÀÌØíÉ}I½ÉÍQµÀ¤´Ä($$$ÀÌØíÉ}I½ÉÍlÀÌØíà´ÈulÀÌØíä´ÅtôÀÌØíÉ}I½ÉÍQµÁlÀÌØíåt($%9áÐ(%¹%)9áÐ)½ÈÀÌØíäôÀѼÈ(%¥±±Ñ ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì¤(%½ÈÀÌØíàôÀѼU  ½Õ¹ ÀÌØíÉ}I½É̤´Ä($$ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåtµÀìõÉ1µÀìÀÌØíÉ}I½ÉÍlÀÌØíáulÀÌØíåt(%9áÐ(%5Í    ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½ÐítôÅÕ½ÐìµÀí1µÀìÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåt¤(%¥±]É¥Ñ ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì°ÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåt¤(%}¥±IQ½ÉÉä ÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì°ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì¤(%}ÉÉå¥ÍÁ±ä ÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹Ì°ÅÕ½ÐìÀÌØíI½ÉÍIÍÕ±ÑÍQ½
½±Õµ¹ÌÅÕ½ÐìµÀìÀÌØíä¤(%ÉչݥРÅÕ½Ðí¹½ÑÁÅÕ½ÐìµÀìÅÕ½ÐíM¡É¹µÌÅÕ½ÐìµÀìÀÌØíäµÀìÅÕ½Ðì¹ÑáÐÅÕ½Ðì¤($ÀÌØí
½±Õµ¹MÑÉ¥¹ÌµÀìôÀÌØí
½±Õµ¹MÑÉ¥¹ÍlÀÌØíåtµÀí1)9áÐ(íø5Í  ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÀÌØí
½±Õµ¹MÑÉ¥¹ÌôÅÕ½ÐìµÀí1µÀìÀÌØí
½±Õµ¹MÑÉ¥¹Ì¤(

Hi,

Actually the file contains tha following information in the same format

Shared resources at \\sydsye

XXXX

Share name Type Used as Comment

-------------------------------------------------------------------------------

sc Disk

testshare Disk testshare

The command completed successfully.

Here i want to send only the Share name to other text file (Here i want to check whether the corresponding Share name exists or not)

is there any way to send only the Share name column to other text file ?

or else is there any way to check whether the corresponding Share name exists or not?

i am getting problem since the above file contains not only the table but also all the unnecessary lines( such as

Shared resources at \\sydsye

XXXX

The command completed successfully.

among these i need only the share name.

is there any way to send only the sharenames to other txt file

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0