Hello friends,
I have a file which consists of many rows, I use a couple of commands to convert it so i can use in a database query for filtering. I need the first columns (msisdns) in a row, seperated with commas,
9855162267,4,5,2010-11-03 17:02:07.627
9594567938f,5,5,2010-11-02 12:47:08.047
9855155486,4,5,2010-11-01 12:26:37.640
9233453445f,5,5,2010-11-02 11:20:43.327
9434326423,5,5,2010-11-01 11:02:02.217
9592416210f,4,5,2010-11-02 10:20:52.063
nawk -F, '{print $1}' FILE | sed -e 's/f$//g' -e 's/\([0-9]\{10\}\)/91\1/g' | nawk '!_[$0]++' | nawk -v RS="\n" -v ORS="," '{}'1
code works well but in output there is a comma at the end and more, so i cant save it to a file. I know it is easier to get rid of it using "print" options but i couldnt, I appreciate any suggestion to remove the colored part, is it also possible without adding another command with pipe?
919855162267,919594567938,919855155486,919233453445,919434326423,919592416210,server{root}/a/b/c>
Regards