Search Results

Search: Posts Made By: aniquebmx
2,327
Posted By RudiC
DON'T use notepad; it will leave DOS style files...
DON'T use notepad; it will leave DOS style files behind. Use genuine unix editors!
13,009
Posted By gacanepa
Try this: gacanepa@debian:~$ cat file.xml ...
Try this:
gacanepa@debian:~$ cat file.xml
hola
chau
me
voy
gacanepa@debian:~$ awk '{$1=$1}1' file.xml
hola
chau
me
voy
gacanepa@debian:~$
You may want to redirect the output of the...
13,009
Posted By zaxxon
@aniquebmx: Why should it change the file?...
@aniquebmx:

Why should it change the file? You didn't ask to change the current file, that's why.
The output you get on the shell should have the leading spaces, whatever they are including tabs,...
13,009
Posted By xbin
You can read all about it here- Regular...
You can read all about it here- Regular expression - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Regular_expression)

sed 's/^[[:blank:]]*//' file.xml
13,009
Posted By zaxxon
Try: sed 's/^[[:space:]]*//' file.xml
Try:

sed 's/^[[:space:]]*//' file.xml
13,009
Posted By bakunin
Close, but not quite: "sed" understands tabs just...
Close, but not quite: "sed" understands tabs just fine, enter them literally ("<b>" means literal blank, "<t>" means literal tab in the following):

sed 's/^[<b><t>]*//' /path/to/file

If you...
13,009
Posted By krishmaths
Assuming you don't have text separated by spaces...
Assuming you don't have text separated by spaces or tabs in a single line

awk '{print $1}' file.xml
2,327
Posted By mjf
I notice a couple of things: 1. From your...
I notice a couple of things:

1. From your input file, you don't need the field separator.
2. From your output file, you don't need the ";" in the print statement, just replace with a comma.
3....
2,327
Posted By krishmaths
Could you explain more on what is the issue? What...
Could you explain more on what is the issue? What is the output you are getting?

I see that your input and output are .csv files. Did you copy paste the input data from excel to here?

I used a...
2,327
Posted By RudiC
Using your input file in post#1, a slight...
Using your input file in post#1, a slight modification of your own code snippet will work:awk '{a[$1]+=$2} END{for (i in a)print i "\t" a[i];}' file
05492U34 85



EDIT: Looking at your...
281,397
Posted By Neo
Updated rules. Change: Code tags are now...
Updated rules.

Change: Code tags are now "the rule" and not just a guideline.
Showing results 1 to 11 of 11

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