Adding an empty line between first and second line in a text file
A file (foo.csv) contain entries (four columns) as follows:
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
In this file, I want to add the total number of lines in the first line followed by an empty line.
I want the output to be as follow.
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
Here is what I tried.
#to get the total number of lines in the file foo.csv
t=$((wc -l foo.csv | cut -d" " -f1))
#to add an empty line
sed -i "1i\" foo.csv
#to insert the total number at the top; this works fine.
sed -i "1i $t" foo.csv
I need to do this for a bunch of files. So, script will be useful. The problem seems to be in sed -i "1i\" foo.csv
. How to correct this?
awk sed
add a comment |
A file (foo.csv) contain entries (four columns) as follows:
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
In this file, I want to add the total number of lines in the first line followed by an empty line.
I want the output to be as follow.
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
Here is what I tried.
#to get the total number of lines in the file foo.csv
t=$((wc -l foo.csv | cut -d" " -f1))
#to add an empty line
sed -i "1i\" foo.csv
#to insert the total number at the top; this works fine.
sed -i "1i $t" foo.csv
I need to do this for a bunch of files. So, script will be useful. The problem seems to be in sed -i "1i\" foo.csv
. How to correct this?
awk sed
1
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
1
This would do :echo -e "$tnn$(cat foo.csv)"
, you should assign variablet
ast=$(wc -l < /path_of_file/foo.csv)
, no othersed
commands required.
– User123
Nov 28 '18 at 4:06
add a comment |
A file (foo.csv) contain entries (four columns) as follows:
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
In this file, I want to add the total number of lines in the first line followed by an empty line.
I want the output to be as follow.
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
Here is what I tried.
#to get the total number of lines in the file foo.csv
t=$((wc -l foo.csv | cut -d" " -f1))
#to add an empty line
sed -i "1i\" foo.csv
#to insert the total number at the top; this works fine.
sed -i "1i $t" foo.csv
I need to do this for a bunch of files. So, script will be useful. The problem seems to be in sed -i "1i\" foo.csv
. How to correct this?
awk sed
A file (foo.csv) contain entries (four columns) as follows:
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
In this file, I want to add the total number of lines in the first line followed by an empty line.
I want the output to be as follow.
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
Here is what I tried.
#to get the total number of lines in the file foo.csv
t=$((wc -l foo.csv | cut -d" " -f1))
#to add an empty line
sed -i "1i\" foo.csv
#to insert the total number at the top; this works fine.
sed -i "1i $t" foo.csv
I need to do this for a bunch of files. So, script will be useful. The problem seems to be in sed -i "1i\" foo.csv
. How to correct this?
awk sed
awk sed
edited Dec 8 '18 at 14:58
marc_s
581k13011211268
581k13011211268
asked Nov 28 '18 at 3:32
phenomenonphenomenon
1338
1338
1
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
1
This would do :echo -e "$tnn$(cat foo.csv)"
, you should assign variablet
ast=$(wc -l < /path_of_file/foo.csv)
, no othersed
commands required.
– User123
Nov 28 '18 at 4:06
add a comment |
1
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
1
This would do :echo -e "$tnn$(cat foo.csv)"
, you should assign variablet
ast=$(wc -l < /path_of_file/foo.csv)
, no othersed
commands required.
– User123
Nov 28 '18 at 4:06
1
1
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
1
1
This would do :
echo -e "$tnn$(cat foo.csv)"
, you should assign variable t
as t=$(wc -l < /path_of_file/foo.csv)
, no other sed
commands required.– User123
Nov 28 '18 at 4:06
This would do :
echo -e "$tnn$(cat foo.csv)"
, you should assign variable t
as t=$(wc -l < /path_of_file/foo.csv)
, no other sed
commands required.– User123
Nov 28 '18 at 4:06
add a comment |
4 Answers
4
active
oldest
votes
If you are ok with awk
could you please try following.
awk -v line=$(wc -l < Input_file) 'FNR==1{print line ORS} 1' Input_file
In case you want to add output into Input_file itself then append > temp_file && mv temp_file Input_file
to above code then.
Explanation: Adding explanation for above code too now.
awk -v line=$(wc -l < Input_file ) ' ##Creating variable line whose value is bash command wc -l to get line count for Input_file as per OP request.
FNR==1{ ##Checking if line number is 1 here then do following.
print line ORS ##Printing variable line here with ORS whose value is new line here.
} ##Closing FNR block here.
1 ##awk works on method of pattern and action mentioning 1 making condition TRUE and no action will make print to happen.
' Input_file ##Mentioning Input_file name here.
add a comment |
do the line counting with awk
as well.
$ awk 'NR==FNR{next} FNR==1{print NR-1 ORS}1' file{,}
or, with tac...tac
$ tac file | awk '1; END{print ORS NR}' | tac
add a comment |
You can do it quite simply using sed
with the 0,addr2
form (see man sed
under "Addresses") with general substitution, e.g.
$ sed '0,/^/s/^/4nn/' file
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
The sed
expression simply finds the first occurrence of the beginning of the line 0,/^/
and then substitutes the beginning of the line with 4nn
, using s/^/4nn/
Add the -i
option to edit-in-place (or -i.bak
to create a back of the original (e.g. file.bak
) while editing in place.
If you are interested in setting the number of lines, then you can simply get the lines with wc -l
using command substitution, e.g.
$ sed "0,/^/s/^/$(wc -l <file2)nn/" file2
8
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
(note: the use of double-quotes instead of single-quotes to allow expansion of the command substitution)
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
You can always usewc -l
to get the number of lines -- I'll edit.
– David C. Rankin
Nov 28 '18 at 4:24
add a comment |
This might work for you (GNU sed):
sed -e '1e wc -l <file' -e '1H;1g' file
or to do everything in sed:
sed -e '1e sed "$=;d" file' -e '1H;1g' file
This uses the e
command to evaluate unix commands. Normally this is done using the e
flag to the s
command, but it can be used following an address, as in this situation.
An alternative, using a pipe:
wc -l <file | sed '1G' - file
or:
sed '$=;d' file | sed '1G' - file
Use the result of a wc or sed command as the first input file.
On retrospect, the easiest solution (although not the most efficient):
sed 'H;$!d;=;x' file
Which slurps the file into the hold space and inserts the number of lines and a blank line before printing out the hold space.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53511698%2fadding-an-empty-line-between-first-and-second-line-in-a-text-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are ok with awk
could you please try following.
awk -v line=$(wc -l < Input_file) 'FNR==1{print line ORS} 1' Input_file
In case you want to add output into Input_file itself then append > temp_file && mv temp_file Input_file
to above code then.
Explanation: Adding explanation for above code too now.
awk -v line=$(wc -l < Input_file ) ' ##Creating variable line whose value is bash command wc -l to get line count for Input_file as per OP request.
FNR==1{ ##Checking if line number is 1 here then do following.
print line ORS ##Printing variable line here with ORS whose value is new line here.
} ##Closing FNR block here.
1 ##awk works on method of pattern and action mentioning 1 making condition TRUE and no action will make print to happen.
' Input_file ##Mentioning Input_file name here.
add a comment |
If you are ok with awk
could you please try following.
awk -v line=$(wc -l < Input_file) 'FNR==1{print line ORS} 1' Input_file
In case you want to add output into Input_file itself then append > temp_file && mv temp_file Input_file
to above code then.
Explanation: Adding explanation for above code too now.
awk -v line=$(wc -l < Input_file ) ' ##Creating variable line whose value is bash command wc -l to get line count for Input_file as per OP request.
FNR==1{ ##Checking if line number is 1 here then do following.
print line ORS ##Printing variable line here with ORS whose value is new line here.
} ##Closing FNR block here.
1 ##awk works on method of pattern and action mentioning 1 making condition TRUE and no action will make print to happen.
' Input_file ##Mentioning Input_file name here.
add a comment |
If you are ok with awk
could you please try following.
awk -v line=$(wc -l < Input_file) 'FNR==1{print line ORS} 1' Input_file
In case you want to add output into Input_file itself then append > temp_file && mv temp_file Input_file
to above code then.
Explanation: Adding explanation for above code too now.
awk -v line=$(wc -l < Input_file ) ' ##Creating variable line whose value is bash command wc -l to get line count for Input_file as per OP request.
FNR==1{ ##Checking if line number is 1 here then do following.
print line ORS ##Printing variable line here with ORS whose value is new line here.
} ##Closing FNR block here.
1 ##awk works on method of pattern and action mentioning 1 making condition TRUE and no action will make print to happen.
' Input_file ##Mentioning Input_file name here.
If you are ok with awk
could you please try following.
awk -v line=$(wc -l < Input_file) 'FNR==1{print line ORS} 1' Input_file
In case you want to add output into Input_file itself then append > temp_file && mv temp_file Input_file
to above code then.
Explanation: Adding explanation for above code too now.
awk -v line=$(wc -l < Input_file ) ' ##Creating variable line whose value is bash command wc -l to get line count for Input_file as per OP request.
FNR==1{ ##Checking if line number is 1 here then do following.
print line ORS ##Printing variable line here with ORS whose value is new line here.
} ##Closing FNR block here.
1 ##awk works on method of pattern and action mentioning 1 making condition TRUE and no action will make print to happen.
' Input_file ##Mentioning Input_file name here.
edited Nov 28 '18 at 4:06
answered Nov 28 '18 at 4:01
RavinderSingh13RavinderSingh13
29.7k41639
29.7k41639
add a comment |
add a comment |
do the line counting with awk
as well.
$ awk 'NR==FNR{next} FNR==1{print NR-1 ORS}1' file{,}
or, with tac...tac
$ tac file | awk '1; END{print ORS NR}' | tac
add a comment |
do the line counting with awk
as well.
$ awk 'NR==FNR{next} FNR==1{print NR-1 ORS}1' file{,}
or, with tac...tac
$ tac file | awk '1; END{print ORS NR}' | tac
add a comment |
do the line counting with awk
as well.
$ awk 'NR==FNR{next} FNR==1{print NR-1 ORS}1' file{,}
or, with tac...tac
$ tac file | awk '1; END{print ORS NR}' | tac
do the line counting with awk
as well.
$ awk 'NR==FNR{next} FNR==1{print NR-1 ORS}1' file{,}
or, with tac...tac
$ tac file | awk '1; END{print ORS NR}' | tac
edited Nov 28 '18 at 4:38
answered Nov 28 '18 at 4:33
karakfakarakfa
50.6k52839
50.6k52839
add a comment |
add a comment |
You can do it quite simply using sed
with the 0,addr2
form (see man sed
under "Addresses") with general substitution, e.g.
$ sed '0,/^/s/^/4nn/' file
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
The sed
expression simply finds the first occurrence of the beginning of the line 0,/^/
and then substitutes the beginning of the line with 4nn
, using s/^/4nn/
Add the -i
option to edit-in-place (or -i.bak
to create a back of the original (e.g. file.bak
) while editing in place.
If you are interested in setting the number of lines, then you can simply get the lines with wc -l
using command substitution, e.g.
$ sed "0,/^/s/^/$(wc -l <file2)nn/" file2
8
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
(note: the use of double-quotes instead of single-quotes to allow expansion of the command substitution)
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
You can always usewc -l
to get the number of lines -- I'll edit.
– David C. Rankin
Nov 28 '18 at 4:24
add a comment |
You can do it quite simply using sed
with the 0,addr2
form (see man sed
under "Addresses") with general substitution, e.g.
$ sed '0,/^/s/^/4nn/' file
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
The sed
expression simply finds the first occurrence of the beginning of the line 0,/^/
and then substitutes the beginning of the line with 4nn
, using s/^/4nn/
Add the -i
option to edit-in-place (or -i.bak
to create a back of the original (e.g. file.bak
) while editing in place.
If you are interested in setting the number of lines, then you can simply get the lines with wc -l
using command substitution, e.g.
$ sed "0,/^/s/^/$(wc -l <file2)nn/" file2
8
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
(note: the use of double-quotes instead of single-quotes to allow expansion of the command substitution)
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
You can always usewc -l
to get the number of lines -- I'll edit.
– David C. Rankin
Nov 28 '18 at 4:24
add a comment |
You can do it quite simply using sed
with the 0,addr2
form (see man sed
under "Addresses") with general substitution, e.g.
$ sed '0,/^/s/^/4nn/' file
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
The sed
expression simply finds the first occurrence of the beginning of the line 0,/^/
and then substitutes the beginning of the line with 4nn
, using s/^/4nn/
Add the -i
option to edit-in-place (or -i.bak
to create a back of the original (e.g. file.bak
) while editing in place.
If you are interested in setting the number of lines, then you can simply get the lines with wc -l
using command substitution, e.g.
$ sed "0,/^/s/^/$(wc -l <file2)nn/" file2
8
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
(note: the use of double-quotes instead of single-quotes to allow expansion of the command substitution)
You can do it quite simply using sed
with the 0,addr2
form (see man sed
under "Addresses") with general substitution, e.g.
$ sed '0,/^/s/^/4nn/' file
4
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
The sed
expression simply finds the first occurrence of the beginning of the line 0,/^/
and then substitutes the beginning of the line with 4nn
, using s/^/4nn/
Add the -i
option to edit-in-place (or -i.bak
to create a back of the original (e.g. file.bak
) while editing in place.
If you are interested in setting the number of lines, then you can simply get the lines with wc -l
using command substitution, e.g.
$ sed "0,/^/s/^/$(wc -l <file2)nn/" file2
8
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
A 5.3 3.2 1.2
A 2.1 3.4 6.7
A 3.4 2.1 5.6
A 0.4 2.2 4.2
(note: the use of double-quotes instead of single-quotes to allow expansion of the command substitution)
edited Nov 28 '18 at 4:27
answered Nov 28 '18 at 4:08
David C. RankinDavid C. Rankin
42.8k33050
42.8k33050
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
You can always usewc -l
to get the number of lines -- I'll edit.
– David C. Rankin
Nov 28 '18 at 4:24
add a comment |
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
You can always usewc -l
to get the number of lines -- I'll edit.
– David C. Rankin
Nov 28 '18 at 4:24
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
The number (for this file 4) may vary for each file. So, I need to use variable in 'sed'.
– phenomenon
Nov 28 '18 at 4:22
1
1
You can always use
wc -l
to get the number of lines -- I'll edit.– David C. Rankin
Nov 28 '18 at 4:24
You can always use
wc -l
to get the number of lines -- I'll edit.– David C. Rankin
Nov 28 '18 at 4:24
add a comment |
This might work for you (GNU sed):
sed -e '1e wc -l <file' -e '1H;1g' file
or to do everything in sed:
sed -e '1e sed "$=;d" file' -e '1H;1g' file
This uses the e
command to evaluate unix commands. Normally this is done using the e
flag to the s
command, but it can be used following an address, as in this situation.
An alternative, using a pipe:
wc -l <file | sed '1G' - file
or:
sed '$=;d' file | sed '1G' - file
Use the result of a wc or sed command as the first input file.
On retrospect, the easiest solution (although not the most efficient):
sed 'H;$!d;=;x' file
Which slurps the file into the hold space and inserts the number of lines and a blank line before printing out the hold space.
add a comment |
This might work for you (GNU sed):
sed -e '1e wc -l <file' -e '1H;1g' file
or to do everything in sed:
sed -e '1e sed "$=;d" file' -e '1H;1g' file
This uses the e
command to evaluate unix commands. Normally this is done using the e
flag to the s
command, but it can be used following an address, as in this situation.
An alternative, using a pipe:
wc -l <file | sed '1G' - file
or:
sed '$=;d' file | sed '1G' - file
Use the result of a wc or sed command as the first input file.
On retrospect, the easiest solution (although not the most efficient):
sed 'H;$!d;=;x' file
Which slurps the file into the hold space and inserts the number of lines and a blank line before printing out the hold space.
add a comment |
This might work for you (GNU sed):
sed -e '1e wc -l <file' -e '1H;1g' file
or to do everything in sed:
sed -e '1e sed "$=;d" file' -e '1H;1g' file
This uses the e
command to evaluate unix commands. Normally this is done using the e
flag to the s
command, but it can be used following an address, as in this situation.
An alternative, using a pipe:
wc -l <file | sed '1G' - file
or:
sed '$=;d' file | sed '1G' - file
Use the result of a wc or sed command as the first input file.
On retrospect, the easiest solution (although not the most efficient):
sed 'H;$!d;=;x' file
Which slurps the file into the hold space and inserts the number of lines and a blank line before printing out the hold space.
This might work for you (GNU sed):
sed -e '1e wc -l <file' -e '1H;1g' file
or to do everything in sed:
sed -e '1e sed "$=;d" file' -e '1H;1g' file
This uses the e
command to evaluate unix commands. Normally this is done using the e
flag to the s
command, but it can be used following an address, as in this situation.
An alternative, using a pipe:
wc -l <file | sed '1G' - file
or:
sed '$=;d' file | sed '1G' - file
Use the result of a wc or sed command as the first input file.
On retrospect, the easiest solution (although not the most efficient):
sed 'H;$!d;=;x' file
Which slurps the file into the hold space and inserts the number of lines and a blank line before printing out the hold space.
edited Nov 28 '18 at 14:38
answered Nov 28 '18 at 9:06
potongpotong
36.1k43062
36.1k43062
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53511698%2fadding-an-empty-line-between-first-and-second-line-in-a-text-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Could you please add more realistic samples of input and expected output in your post as it is not clear.
– RavinderSingh13
Nov 28 '18 at 3:33
1
This would do :
echo -e "$tnn$(cat foo.csv)"
, you should assign variablet
ast=$(wc -l < /path_of_file/foo.csv)
, no othersed
commands required.– User123
Nov 28 '18 at 4:06