Search Results

Search: Posts Made By: karthik_ak
10,329
Posted By Lucas_0418
Hi, looks like your environment is so different...
Hi, looks like your environment is so different with me.
For your code, I find that once $_=<> executed, the very first line would be deleted.
So may you try this?
perl -pi.orig -e '$/=undef;...
10,329
Posted By wisecracker
Using builtins only on OSX 10.7.5 default...
Using builtins only on OSX 10.7.5 default shell...

There may well be a much better method using builtins but this works
and is a starting point.

I appended "sample.txt" 3 times with a newline...
10,329
Posted By Don Cragun
Since you're running on Windows, it may be that...
Since you're running on Windows, it may be that your input file's lines are terminated by a carriage return character and a newline character. Since awk is expecting just newline as the line...
10,329
Posted By Scrutinizer
There are also (single) quoting issues with awk...
There are also (single) quoting issues with awk on Windows, I seem to recall. He may need to run it as
awk "{while(NF<12){getline p; \$0=\$0 p}}1" FS=, OFS=, file or something or put the script in a...
4,216
Posted By durden_tyler
Given a file like this: $ $ cat -v f8 ...
Given a file like this:


$
$ cat -v f8
ABC^M^M^M
DEF
GHI^M
JKL
MNO^M^M
PQR
STU^M^M^M^M^M^M^M
VWX^M^M^M^M
YZ
$
I shall assume that you want to remove to:
(a) remove "^M"s
(b) join...
4,216
Posted By mwrg
You are correct durde. thats how my file looks....
You are correct durde. thats how my file looks. in your code how can i specify the input file and output file?

---------- Post updated at 09:50 AM ---------- Previous update was at 09:31 AM...
10,329
Posted By ahamed101
Try this... #!/bin/bash incom=0 ...
Try this...


#!/bin/bash

incom=0
while read line
do
if [ $incom -eq 1 ]; then
incom=0
printf "%s%s\n" "$data" "$line"
data=""
continue
fi

grep ",$" <<<$line...
Showing results 1 to 7 of 7

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