Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

777.Text file parser -- How to extract the first 10 and last 10 characters from each line?

User: editor -- 2011-05-10          << 776  778 >>
Hits: 3877
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract the first 10 and last 10 characters from each line in a text file? Like excel function left and right.
Input Sample:
ABCDEFGHIJKLMNOPQRSTUVWXYZ 
ABCDEFGHIJKLMNOPQRSTUVWXYZ 
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output Sample:
ABCDEFGHIJQRSTUVWXYZ 
ABCDEFGHIJQRSTUVWXYZ 
ABCDEFGHIJQRSTUVWXYZ 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file 
2. ctrl-h open 'replace' dialog 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
3. click 'replace', done! 
 
Hint: 
chars(text,1,10) is equivalent to excel function left(text,10) 
chars(text,-10,-1) is equivalent to excel function right(text,10) 
chars(text,3,8) is equivalent to excel function mid(text,3,6) 

Screenshot 1:  Replace_Window


Similar Examples:
How to remove the first 10 characters of each line in text file? (70%)
How can I add a word before the last 10 characters of each line? (68%)
How to add first line to the start of each line? (67%)
How to add a space in the middle of the two characters in each line? (65%)
How to extract first 55 characters form multiple .txt.files? (64%)
How to extract all lines with more than 30 characters from multiple files? (64%)
How to reverse the order of characters in each line of text? (64%)
How to extract the text between first comma and second comma in each line? (63%)

Check Demo of Text file parser
Keywords:
110  101  excel  first 10  toc  function  last  right  characters  las  extract first 10 characters from file  extract first 10 characters text file  replace 10 first characters  extract function parser  extract to excel  extract excel  parser extract left  text to excel