Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
614.Text generator -- How to duplicate column A by the number of times in column B in csv file?
User:
editor -- 2010-09-18
<< 613
615 >>
Hits:
3358
Type:
Text generator
Search all
Text generator
examples
Description:
How to duplicate column A by the number of times in column B in csv file?
Input Sample:
AAA,2
BBB,15
CCC,10
...
Output Sample:
AAA
AAA
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
BBB
CCC
CCC
CCC
CCC
CCC
CCC
CCC
CCC
CCC
CCC
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open csv file
2. ctrl-h open 'replace' window
* set 'replace unit' to 'Line'
* set 'replace with pattern' to:
scalar( (words($match,1,1,',')."\n") x words($match,2,2,',') )
3. click 'replace', done!
4. ctrl-s save to file.
Screenshot 1: Replace_Window
Similar Examples:
How to multiply the first column with the rest of columns in one file?
(67%)
How to set column N according to content of column A in csv file?
(66%)
How to set column N according to some words in column A in csv file?
(64%)
How to calculate the sum of the numbers in the same column?
(64%)
How to add some number to the specific column in csv file?
(63%)
How to duplicate each line 5 times in a text file?
(63%)
How to exchange column 2 and column 3 in multiple csv files?
(62%)
How to copy column A to column D if column D is blank(absent) in a csv file?
(61%)
Check Demo of
Text generator
Keywords:
duplicate column
scalar
times
duplicate
duplicat
dupl
csv
time
text generator
generator
duplicate csv
duplicate 3 times
replace times
replace duplicate
replace number column
replace column csv
duplicate file
column csv