Code Comments
Programming Forum and web based access to our favorite programming groups.Rookie Card wrote: > William - > The files don't have leading spaces but do have spaces in the middle > Like this: > > 200409113 834736A90028 > CLIENTID 00VNI112B92658 > CLIE ID000VNI118S98271 > 200411 34129983A93065 > > The spaces are never consistant as they represent a fixed lenth field > and the data is not always the same legnth. Although the posistion of > the records identifier ( A ) is always the same if you count the > spaces. (Fixed length records with fixed field widths) > I also tried awk '/A/' REC18.txt > the output returned all records. That's impossible given the input file you showed above. Ed.
Post Follow-up to this messageIn article <crjpdc$it6@netnews.proxy.lucent.com>, Ed Morton <morton@lsupcaemnt.com> wrote: ... > >That's impossible given the input file you showed above. > > Ed. There is some kind of fundamental miscommunication going on in this thread. For one, it is clear that the OP hasn't a clue about how AWK works. He should acquire and read thoroughly some basic texts. Second, I think there may be some kind of shell-quoting issue going on -- which is a nice way of saying, "I think he is using MS DOS w/o telling us and we are, quite naturally, assuming Unix."
Post Follow-up to this messageRookie Card wrote: > William, > That worked! > I used the Kernighan version of awk for win32. > awk "\"A\"==substr($0,18,1)" REC18.txt >RECA.txt > The problem was gnu version 3.1.3 of gawk.exe > Given your other postings where you didn't use the above syntax, I doubt if gawk was really the problem. Try it again using exactly the syntax above. Ed.
Post Follow-up to this messageIn article <crjpdc$it6@netnews.proxy.lucent.com>, Ed Morton <morton@lsupcaemnt.com> wrote: ... > >That's impossible given the input file you showed above. > > Ed. There is some kind of fundamental miscommunication going on in this thread. For one, it is clear that the OP hasn't a clue about how AWK works. He should acquire and read thoroughly some basic texts. Second, I think there may be some kind of shell-quoting issue going on -- which is a nice way of saying, "I think he is using MS DOS w/o telling us and we are, quite naturally, assuming Unix."
Post Follow-up to this messageRookie Card wrote: > William, > That worked! > I used the Kernighan version of awk for win32. > awk "\"A\"==substr($0,18,1)" REC18.txt >RECA.txt > The problem was gnu version 3.1.3 of gawk.exe > Given your other postings where you didn't use the above syntax, I doubt if gawk was really the problem. Try it again using exactly the syntax above. Ed.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.