File manipulation

P

PolyPusher

Guest
Hi,

I have a file with a list of blocks in a Unix dir...

ga935a_01a
ga935a_01b
ga935a_01c
ga935a_01d
ga935a_01e
ga935a_01f
ga935b_01a
ga935b_01b
ga935b_01c
ga935c_01a
ga935c_01b
ga935c_01c
ga935c_01d
ga935c_01e
ga935c_01f
ga935d_01a
ga935d_01b
ga935d_01c

I want to turn this into a list for skill....

("ga935a_01a" "ga935a_01b" "ga935a_01c" "ga935a_01d" ..........
"ga935d_01c")

I know how to get out to unix and back, can I read this file in the
format given and do what I want in Skill?

Thank you for any help in advance,
Eric
 
On Apr 27, 11:30 pm, PolyPusher <eric.d.fitzsimm...@gmail.com> wrote:
Hi,

I have a file with a list of blocks in a Unix dir...

ga935a_01a
ga935a_01b
ga935a_01c
ga935a_01d
ga935a_01e
ga935a_01f
ga935b_01a
ga935b_01b
ga935b_01c
ga935c_01a
ga935c_01b
ga935c_01c
ga935c_01d
ga935c_01e
ga935c_01f
ga935d_01a
ga935d_01b
ga935d_01c

I want to turn this into a list for skill....

("ga935a_01a" "ga935a_01b" "ga935a_01c" "ga935a_01d" ..........
"ga935d_01c")

I know how to get out to unix and back,  can I read this file in the
format given and do what I want in Skill?

Thank you for any help in advance,
Eric
Hi Eric,

A procedure like:

;; put all the lines of a file into a list
procedure( file2List(myFile)
let( (pIn line retList)
pIn = infile(myFile)
while( gets(line pIn)
;; remove new line
retList = cons(car(parseString(line "\n")) retList)
)
;; elements were added into the opposite order
retList = reverse(retList)
)
)


And then just call:
myList = file2List("my_input.txt")


BR,
Marcel
 
On Apr 27, 11:27 pm, Marcel Preda <marcel.pr...@gmail.com> wrote:
On Apr 27, 11:30 pm, PolyPusher <eric.d.fitzsimm...@gmail.com> wrote:





Hi,

I have a file with a list of blocks in a Unix dir...

ga935a_01a
ga935a_01b
ga935a_01c
ga935a_01d
ga935a_01e
ga935a_01f
ga935b_01a
ga935b_01b
ga935b_01c
ga935c_01a
ga935c_01b
ga935c_01c
ga935c_01d
ga935c_01e
ga935c_01f
ga935d_01a
ga935d_01b
ga935d_01c

I want to turn this into a list for skill....

("ga935a_01a" "ga935a_01b" "ga935a_01c" "ga935a_01d" ..........
"ga935d_01c")

I know how to get out to unix and back,  can I read this file in the
format given and do what I want in Skill?

Thank you for any help in advance,
Eric

Hi Eric,

A procedure like:

;; put all the lines of a file into a list
procedure( file2List(myFile)
let( (pIn line retList)
    pIn = infile(myFile)
    while( gets(line pIn)
        ;; remove new line
        retList = cons(car(parseString(line "\n")) retList)
    )
    ;; elements were added into the opposite order
    retList = reverse(retList)
)
)

And then just call:
myList = file2List("my_input.txt")

BR,
Marcel- Hide quoted text -

- Show quoted text -
That worked great!!

Thank you,
Eric
 

Welcome to EDABoard.com

Sponsor

Back
Top