Skip to main content
deleted 21 characters in body
Source Link
terdon
  • 252.3k
  • 69
  • 480
  • 718

I have a csv file, and I want to delete lines whose third field is longer that 1if their 12th character in lengthis not ;.

So, for example, my file looks like this:

2266308;A;B;dfsgsfdg    
2266309;A;BJHSADFK;gfsdg
2266310;A;B;dfg

and I want:

2266308;A;B;dfsgsfdg
2266310;A;B;dfg

How can I remove a line if the 12th character in it is NOT ; with sed? =)

I have a csv file, and I want to delete lines whose third field is longer that 1 character in length.

So, for example, my file looks like this:

2266308;A;B;dfsgsfdg    
2266309;A;BJHSADFK;gfsdg
2266310;A;B;dfg

and I want:

2266308;A;B;dfsgsfdg
2266310;A;B;dfg

How can I remove a line if the 12th character in it is NOT ; with sed? =)

I have a csv file, and I want to delete lines if their 12th character is not ;.

So, for example, my file looks like this:

2266308;A;B;dfsgsfdg    
2266309;A;BJHSADFK;gfsdg
2266310;A;B;dfg

and I want:

2266308;A;B;dfsgsfdg
2266310;A;B;dfg

How can I remove a line if the 12th character in it is NOT ; with sed? =)

added 14 characters in body; edited tags
Source Link
terdon
  • 252.3k
  • 69
  • 480
  • 718

I have a csv file, and iI want to delete lines from it that haswhose third cellfield is longer that 1 character lenghtin length.

soSo, for example, my file looks like this:

2266308;A;B;dfsgsfdg

2266309;A;BJHSADFK;gfsdg

2266310;A;B;dfg

2266308;A;B;dfsgsfdg    
2266309;A;BJHSADFK;gfsdg
2266310;A;B;dfg

and iI want output:

2266308;A;B;dfsgsfdg

2266310;A;B;dfg

2266308;A;B;dfsgsfdg
2266310;A;B;dfg

How can iI remove a line if the 12th character in it is NOT ";"; with sed? =)

I have a csv file, and i want to delete lines from it that has third cell longer that 1 character lenght.

so for example my file looks like this

2266308;A;B;dfsgsfdg

2266309;A;BJHSADFK;gfsdg

2266310;A;B;dfg

and i want output

2266308;A;B;dfsgsfdg

2266310;A;B;dfg

How can i remove a line if 12th character in it is NOT ";" with sed? =)

I have a csv file, and I want to delete lines whose third field is longer that 1 character in length.

So, for example, my file looks like this:

2266308;A;B;dfsgsfdg    
2266309;A;BJHSADFK;gfsdg
2266310;A;B;dfg

and I want:

2266308;A;B;dfsgsfdg
2266310;A;B;dfg

How can I remove a line if the 12th character in it is NOT ; with sed? =)

Source Link

Sed delete line if nth character is not specific character

I have a csv file, and i want to delete lines from it that has third cell longer that 1 character lenght.

so for example my file looks like this

2266308;A;B;dfsgsfdg

2266309;A;BJHSADFK;gfsdg

2266310;A;B;dfg

and i want output

2266308;A;B;dfsgsfdg

2266310;A;B;dfg

How can i remove a line if 12th character in it is NOT ";" with sed? =)