I've requirement of populating two blank column ( 4rth and 6th ) in a csv file with specified value for all the rows having value within the first colmn.
I know it can be done with sed, as given in the below command, but i am not sure how pull blank value or specify target column etc or check for rows having values etc.
I've requirement of populating two blank column ( 4rth and 6th ) in a csv file with specified value for all the rows having value within the first colmn.
Try this:
Last edited by Franklin52; 01-05-2011 at 02:22 PM..
This User Gave Thanks to Franklin52 For This Post:
Good Afternoon Team -
I"m asking for assistance on a piece of code to populate two values in an XML file. I have it working perfectly using CScript for DOS, but I have a need to do that same process in a Linux environment.
Here is the XML I need to modify:
<?xml version="1.0"... (5 Replies)
Hi All,
I am trying to find out awk one liner for the following requirement but failed in doing that.
I have two files.
Content of first file:
file1.txt SUCCESS A
file2.txt SUCCESS B
file3.txt SUCCESS A
file4.txt FAIL ... (7 Replies)
Hi Guys,
I've got a script that runs and collects statistics from one of our machines and outputs the data into a csv file. Now, that script runs fine and I managed to create another one (with a lot of help from this forum!!) to trim the csv file down to all the data that I need, rather than all... (9 Replies)
I have a list of filenames that I want created - they must be created via a certain naming convention due to the software I'm using. Once they are created I have another file that will be used to populate them with data. So far this is what I have:
#For each line in text file "foo_txt" create... (2 Replies)
Hi.
I am trying to populate an array using eval in the background within a function. So this function will create a list of 3 character directories from SVN and store in an array. I want to call this function when the script starts in the background unknown to the user.
The problem is that... (2 Replies)
Hi,
I'm trying to populate bash script variable, data_size with the
size of the largest file in my current directory
data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }'
I've tried adding an echo before the call to awk
data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
Hi,
I've a php scirpt that calls in an external class. The external class, myClass, has several public and private functions.
There is one public function which derives a value that I want be able to bring it to the main php scirpt. Here is the code.
....snip....
include... (1 Reply)
Hello
I am new to perl and learning ...can you please explain why am i getting this error...as myHash is defined right above the code and I think it should be avilable in the sub function.
Here is my code:
<code>
#!/usr/bin/perl
use warnings;
use strict;
%myHash=();
sub... (2 Replies)
Hi there
i am trying to pass the result of a remote command into a variable into my script
ie
#!/bin/sh
var = `ssh remote_box 'uname'`
echo $var
but all i get back is
./script.sh: var: not found
However when i add a -x to put it into diag mode i get the following
+ ssh... (2 Replies)
Hello,
I am trying to use the awk getline command to populate an array from a flat file.
Has anyone done this before?
So we have file1:
a
b
c
d
I want to create an array like index that contains these four elements (8 Replies)