Search Results

Search: Posts Made By: shell_boy23
6,509
Posted By shell_boy23
Sorry, Klashxx. It gives the same output. ...
Sorry, Klashxx.
It gives the same output.


$ cat samp.txt
1,abc,def,1234,A *
2,bed,dec,342,* A
3,dec,345,23,*&^
4,sdf,fgh,234,
5,ert,345,ghj,C*2
6,ert,345,sdf,123

$ awk -F, '{if ($NF ~...
6,509
Posted By shell_boy23
I tuned the regex as suggested. But it does not...
I tuned the regex as suggested. But it does not give the required output.
code used:

awk -F, '{if ($NF ~ /[0-9]$|[A-Za-z]$/) print >"goodfile"; else print >"badfile"}' samp.txt


samp.txt
...
6,509
Posted By shell_boy23
Need HELP with AWK split. Need to check for "special characters" in string before splitting the file
Hi Experts.

I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file.


awk -F, '{if ($NF ~ /^[0-9]|^[A-Za-z]/)...
12,972
Posted By shell_boy23
Thanks, Scrutinizer. This works perfectly fine. ...
Thanks, Scrutinizer. This works perfectly fine.

---------- Post updated at 03:40 AM ---------- Previous update was at 03:09 AM ----------

Hi Scrutinizer,

I'm going with the below logic you...
12,972
Posted By shell_boy23
HELP with AWK or SED. Need to replace the commas between double quotes in CSV file
Hello experts,

I need to validate a csv file which contains data like this:
Sample.csv

"ABCD","I",23,0,9,,"23/12/2012","OK","Street,State, 91135",0...
8,063
Posted By shell_boy23
Splendid, Guys! I'm going by Klsshxx's way. It...
Splendid, Guys!
I'm going by Klsshxx's way. It works like a charm and fits my requirement like a glove.

116@434 and elixir_sinari's tips are also very helpful.

Thanks for the quick...
8,063
Posted By shell_boy23
HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?
Hello experts,

I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp:...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy