Search Results

Search: Posts Made By: kraterions
2,096
Posted By Just Ice
this one only needs to start one time and will...
this one only needs to start one time and will self-restart ...
#! /bin/ksh

endtime=$(date +%H":"%M) ## assumes endtime is exactly 24 hours after starttime

processfile(){
...
3,995
Posted By durden_tyler
$ $ cat inputfile.csv ...
$
$ cat inputfile.csv
VALUE,USER1,relatedUSER1,relatedUSER2
-1,userA,userB,userC
1,userN,userD,userB
0,userF,userH,userG
0,userT,userH,userB
1,userN,userB,userA
-1,userA,userF,userC...
2,849
Posted By rajamadhavan
$ cat file | xargs -n 2 echo | tr " " "," ...
$ cat file | xargs -n 2 echo | tr " " ","
content1,content2
content1,content2
content1,content2
content1,content2



$ cat file | xargs -n 3 echo | tr " " ","
content1,content2,content1...
2,849
Posted By RudiC
No. Try awk 'NR%2 {x=$1;next} {print x","$1}'...
No. Try awk 'NR%2 {x=$1;next} {print x","$1}' file
content1,content2
content1,content2
content1,content2
content1,content2


And, in my other post, remove one comma from -d",,\n". Sorry,...
2,849
Posted By Yoda
Another paste approach: paste -d, - - < file ...
Another paste approach:
paste -d, - - < file
Another awk approach:
awk 'NR%2{ORS=OFS}!(NR%2){ORS=RS}1' OFS=, file
2,849
Posted By Yoda
I don't know why, but it works for me: $ cat...
I don't know why, but it works for me:
$ cat file

content1
content2
content3

content1
content2
content3

content1
content2
content3

$ xargs -n3 < file | tr ' ' ','...
2,849
Posted By RudiC
Try also:awk '{$1=$1}1' RS="" OFS=","...
Try also:awk '{$1=$1}1' RS="" OFS="," file
2,849
Posted By RudiC
paste -s -d",,\n" file ...
paste -s -d",,\n" file
content1,content2,content3
content1,content2,content3
content1,content2,content3
2,849
Posted By Yoda
Another approach: xargs -n3 < file | tr ' '...
Another approach:
xargs -n3 < file | tr ' ' ','
2,849
Posted By rajamadhavan
awk -F"\n" 'BEGIN{RS=""; OFS=",";} {print...
awk -F"\n" 'BEGIN{RS=""; OFS=",";} {print $1,$2,$3}' file
2,849
Posted By RudiC
Did you try the hint in...
Did you try the hint in https://www.unix.com/302820927-post10.html? (https://www.unix.com/302820927-post10.html)
7,958
Posted By Chubler_XL
The commas for decimal point are most likely...
The commas for decimal point are most likely related to your locale.

Unfortunately different Unix flavors have different ways of setting this, from the shell try:
$ LC_ALL=en_US.UTF-8 ; export...
7,958
Posted By Chubler_XL
You could also try an awk solution: awk -F,...
You could also try an awk solution:

awk -F, '
NR>1 {
split(tolower(substr($0, length($1","$2",")+1)), words, "[^A-Za-z_\047]")
for(wnum in words) {
w=words[wnum]
...
7,958
Posted By Skrynesaver
Hi Kraterions, that wasn't a script, but...
Hi Kraterions,

that wasn't a script, but rather a command line one off, as a script it would look like this, with advised addons.

#!/usr/bin/perl
use strict;

open(my $tweets, $ARGV[0])||...
Showing results 1 to 14 of 14

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