Hello,
I have text file while looks this
test1
test2
test3
test4
test5
test6
and if I want to parse it and make new file which would like this
test1 test2
test3 test4
test5 test6
How can I do this in korn shell script
Thanks
Hello,
I have text file while looks this
test1
test2
test3
test4
test5
test6
and if I want to parse it and make new file which would like this
test1 test2
test3 test4
test5 test6
How can I do this in korn shell script
Thanks
cat file | paste - -
Why, vgersh99, you surprise me. See the site mentioned in this post.
As I read somewhere, more than one way to skin this cat:
sed 'N;s/\n/ /' < inputfile
awesome thank you, it works
Your cat was not as useless as mine was.
My bad - beat me with my own argument - good catch.
paste - - < file
ran into new issue, since I have the file
TEST1 TEST2
TEST3 TEST4
TEST4 TEST6
How do I convert this to lower case?
awk '{ print $1 $2| "tr '[A-Z]' '[a-z]'"}' filename
But tr takes away the newline, is there a different way to do it?
--Peeyush
awk '{ print tolower($0)}' filename
or if it's related to the original posting:
paste - - < file | tr '[A-Z]' '[a-z]'
thanks for the reply
But this is if I already have
TEST1 TEST2
TEST3 TEST3
format
awk '{ print tolower($0) print tolower($1)}' file somehow didn't work
nevermind, it works, thanks tr command works :rolleyes:
You have syntaxes in the above ....
do either
awk '{ print $0 }' file1 | tr '[A-Z]' '[a-z]'
or simply
tr "[A-Z]" "[a-z]" < file1
or suggestions from "vgersh99"