Search Results

Search: Posts Made By: Prashanth B
1,936
Posted By krishmaths
You need to use awk variables. awk -F","...
You need to use awk variables.


awk -F"," -v v1=$ColumnCnt '{if(NF<v1) {print "Line number : "NR" has less number of columns which is a split record." }}' filename
1,936
Posted By krishmaths
Assuming if number of fields is less than 4 then...
Assuming if number of fields is less than 4 then it is a split record:

awk -F"," '{if(NF<4) {print "Line number : "NR" has less number of columns which is a split record." }}' filename


If...
3,861
Posted By Revansidhu
try this one ! code: i=0 while [ $i -le 4 ]...
try this one !
code:
i=0
while [ $i -le 4 ]
do
i=`expr $i + 1`
cp details.csv details$i.csv
done
3,154
Posted By hanson44
The best way is: cat fileA fileB > fileC
The best way is:
cat fileA fileB > fileC
3,154
Posted By hanson44
Try making a test case to get this part working: ...
Try making a test case to get this part working:
$ cat test.txt
file_1|process_1|cnt_1
file_2|process_2|cnt_2

$ cat test.sh
#!/bin/bash
IFS='|'
while read fname Process_dt rec_cnt; do
...
Forum: AIX 04-05-2013
3,538
Posted By 116@434
Output is as you expect i.e. 06/25/2010 ...
Output is as you expect i.e. 06/25/2010
working:
months is assigned a string with 3 chars for each month
getting value of month in then pure mathematics (i.e. position of your input month /3...
Forum: AIX 04-05-2013
3,538
Posted By 116@434
date=$1 looks like a wrong assignment, change it...
date=$1 looks like a wrong assignment, change it to $2. And you might need to change the print's variables placements.

---------- Post updated at 01:36 AM ---------- Previous update was at 01:34...
Showing results 1 to 7 of 7

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