+ Reply to Thread
Results 1 to 3 of 3

Thread: need to remove LINE FEED characters if LINE FEED position is < 361

  1. #1

    Post need to remove LINE FEED characters if LINE FEED position is < 361

    I have a file which has end of line signified by a LINE FEED only (hex '0A'), however there are some text values in the file which also contain LINE FEED character.
    I need to remove all LINE FEED characters that occur in the file before position 361 and keep any LINE FEED characters that are AFTER this position. I want to do
    this in a bat file - looks like REPLACE_BLOCK may work - but I cannot find any examples of how to use this.

    I tried
    f:\shared\vedit\vpw -q -c'Replace_Block("|h0A","",1,360,ALL) Xall'n source_file_name -a destination_file_name

    but this did not work.

    VEDIT is installed on a server and I am executing the bat file from another application.

  2. #2
    Just a thought, which you may have already considered, but, I thought to mention it:

    Is there another character (or string of characters) that ALWAYS adjoin the linefeed characters that are after the position 361?
    Or perhaps there are a few such cases of strings attached with those linefeeds?
    If there is, you could first replace those strings (with the linefeeds you wish to keep) with other unique characters, then remove all linefeeds, then replace those unique characters back to the original strings, thus retaining the linefeeds after 361.
    folioite
    VEDIT 6.24.2, Win 10/64 Pro
    Using VEDIT daily, since 1987...

  3. #3
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    317
    Quote Originally Posted by srpolit View Post
    I have a file which has end of line signified by a LINE FEED only (hex '0A'), however there are some text values in the file which also contain LINE FEED character.
    I need to remove all LINE FEED characters that occur in the file before position 361 and keep any LINE FEED characters that are AFTER this position. I want to do
    this in a bat file - looks like REPLACE_BLOCK may work - but I cannot find any examples of how to use this.

    I tried
    f:\shared\vedit\vpw -q -c'Replace_Block("|h0A","",1,360,ALL) Xall'n source_file_name -a destination_file_name

    but this did not work.

    VEDIT is installed on a server and I am executing the bat file from another application.

    Hi,

    Just another thought. I would try an "if else " construction. Here is my pseudo code:
    Search(h10) if { Cur_Pos < 361 } Del_Char else EndOfFile. Then try a repeat loop.

    -peter

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts