Remove String from txt file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
cumhur_28
Posts: 22
Joined: 22 Jul 2014 13:03

Remove String from txt file

#1 Post by cumhur_28 » 22 Jul 2014 13:10

Hi to everybody;
firstly sorry for my english;
i need a batch file to remove string from txt file and i searched everywhere but i didnt find it.
please help me

i have a txt file like


AHMET AKIN|23453212|03.03.2014|ANKARA
SDKLS SDSD|32423324|04.04.2014|ANKARA

i want my output txt like
23453212
32423324


is there ant dos command to do it.

please helpp

regards

Cumhur

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Remove String from txt file

#2 Post by foxidrive » 22 Jul 2014 14:19

Code: Select all

@echo off
for /f "usebackq tokens=2 delims=|" %%a in ("file.txt") do >>"newfile.txt" echo %%a
pause

cumhur_28
Posts: 22
Joined: 22 Jul 2014 13:03

Re: Remove String from txt file

#3 Post by cumhur_28 » 22 Jul 2014 14:30

thank you my friend it Works
i am so greatfull to you
best regards

Post Reply