4 added 55 characters in body
source | link

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

the above is when your data delimited by tab or space, in case it's different than these we could tell it to awk with its -F"DELIMITER"-F"DELIMITER", which DELIMITER represents your file feilds delimiter.

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

the above is when your data delimited by tab or space, in case it's different than these we could tell it to awk with its -F"DELIMITER".

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

the above is when your data delimited by tab or space, in case it's different than these we could tell it to awk with its -F"DELIMITER", which DELIMITER represents your file feilds delimiter.

3 added 145 characters in body
source | link

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

the above is when your data delimited by tab or space, in case it's different than these we could tell it to awk with its -F"DELIMITER".

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

the above is when your data delimited by tab or space, in case it's different than these we could tell it to awk with its -F"DELIMITER".

2 added 195 characters in body
source | link

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

easy with awk command

awk '{print $1".txt"}' infile.txt

easy with awk command

awk '{print > $1".txt"}' infile.txt

this will produce two files "a.txt" containing those lines which column one is only "a" and "b.txt" containing those lines which column one is only "b" if your column one only contains a or b

1
source | link