columns
UNIX Guru Dude
geof at denali.is.net
Wed Feb 21 18:51:48 EST 1996
I can share two ways to do this. I'm not sure if you want to retain
white space or not. The first example retains white space, the second
strips white space (spaces and tabs).
# retain white space
awk -F '|' '{for (i = 1; i <= NF; i++) print $i}' stuff
# strip white space, inside the [] is a space and tab
awk -F '|' '{gsub("[ ]", "");for (i = 1; i <= NF; i++) print $i}' stuff
$ cat foo
this | is | a | test
# cat -evt foo
this | is |^I^I^Ia^I| ^Itest$
}
}Does anyone know an easy way to cause a list of fields to be
}converted to a column of fields?
}
}eg. take the file with '|' as the field seperator:
}
}every | good | boy | does | fine
}
}and you want it to be:
}
}every
}good
}boy
}does
}fine
}
}I have tried using sed to no avail. I could write a short c program
}but this seems overkill. I am hoping there is some quick linux trick
}to accomplish this. Thanks!
}
}Jim (jnm at saf.com)
}
}James N. McClatchey P.E. (Southern Aluminum Finishing Co, Atlanta, GA, USA)
}Architectural Aluminum. Custom Fabrication. Paint, Powder Coating, Anodizing
}mailto:jnm at saf.com Voice: 404-355-1560 Fax: 404-350-0581
}http://www.saf.com" SAF Home Page
}
}
--
Until Later,
Geoffrey Myers geof at denali.is.net eiger at ichange.com gamyers at attmail.com
http://www.ticllc.net/~geof
More information about the Ale
mailing list