Search found 212 matches

by darioit
16 Sep 2020 22:37
Forum: DOS Batch Forum
Topic: Forfiles and escape char
Replies: 2
Views: 103

Re: Forfiles and escape char

Thank you Steffen, always the best!

I try only 1 caret before parentesis, but not before equal
by darioit
16 Sep 2020 04:16
Forum: DOS Batch Forum
Topic: Forfiles and escape char
Replies: 2
Views: 103

Forfiles and escape char

Hello, this string works fine in dos shell curl --request POST "https://somesite/access_token" --user user:pass | grep -o -P -e "(?<=\"access_token\":\").+?(?=\")" but If I try this: for /f %%a in ('curl --request POST "https://somesite/access_token" --user user:pass ^| grep -o -P -e "(?<=\"access_t...
by darioit
04 Sep 2020 00:03
Forum: DOS Batch Forum
Topic: Merge two file in a new one
Replies: 4
Views: 474

Re: Merge two file in a new one

I thought about it, if empty just copy

Thanks
Dario
by darioit
03 Sep 2020 04:00
Forum: DOS Batch Forum
Topic: Merge two file in a new one
Replies: 4
Views: 474

Re: Merge two file in a new one

Many thank works fine, I had another problem, I use this command "findstr /livg:" for merge two file in a new one in both direction, but command FAIL if a second file is empty, how can I solve this problem? a.txt 1st_file_1st_row 2nd_file_2st_row 1st_file_3st_row 1st_file_4st_row 1st_file_4st_row 1s...
by darioit
21 Aug 2020 06:22
Forum: DOS Batch Forum
Topic: Merge two file in a new one
Replies: 4
Views: 474

Merge two file in a new one

Hello, I try to solve in many way this problem without success, maybe you have the solution my goal is merge file a.txt and b.txt into new one, read first file and if first item is present in second file update it in c.txt file, if not just copy row from a.txt to c.txt first file a.txt AAA;2020-09-0...
by darioit
17 Apr 2019 04:47
Forum: DOS Batch Forum
Topic: Skip n. line before match pattern
Replies: 1
Views: 1051

Re: Skip n. line before match pattern

Solved put each row in a temp file and when match row print temp file
by darioit
16 Apr 2019 09:21
Forum: DOS Batch Forum
Topic: Skip n. line before match pattern
Replies: 1
Views: 1051

Skip n. line before match pattern

Hello folks, here another problem, I had to read text file and print it, but when I match a string starting tag AB3 for example year "2019" I want to skip raw (unknow) find and raw until prev tag AB3, after continue to read file with same method ex. AB1 data AB2 data AB3 2017 AB1 data AB3 2018 AB1 d...
by darioit
03 May 2018 02:23
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

Re: get only last file of same type

you're right, I miss it !!
Thank you
by darioit
02 May 2018 05:46
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

Re: get only last file of same type

Just a quick question, what's is this

Code: Select all

^>^>"%string%" 


it type file content on screen not in a file destination
by darioit
01 May 2018 23:38
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

Re: get only last file of same type

this is exactly what I had in mind, put each data in a array to get last file and, after read the array and delete or keep data,many thanks it works very very well !!
by darioit
30 Apr 2018 12:14
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

Re: get only last file of same type

Yes at 99,99% the last 5 digit are sequential and higher is last file received, maybe is easier find the last file using this value
by darioit
30 Apr 2018 08:41
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

Re: get only last file of same type

I wrote this code, but works only if a file are ordered before first dot. How can I order first qualifier name before dot (EEEEEEEE)? @echo off setlocal EnabledelayedExpansion set file1="" set file2="" for /f "tokens=1,2,3,4 delims=." %%a in ('dir *.DDDDDDDD.* /b/a-d/o-d') do ( set file1=%%a.%%b.%%c...
by darioit
27 Apr 2018 04:08
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 2916

get only last file of same type

Hello everybody, a new problem at least difficult for me In a directory I have different file, I must add each one for same name at 3th position in a new file one and delete it after copy. This is a script and it works fine for /F %%a in ('dir %folder%\*.DDDDDDDD.* /b/a-d/od') do type "%folder%\%%a"...
by darioit
17 Mar 2018 03:47
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 3685

Re: Clean text

another hint, filter is enough on dots ....
thank you
by darioit
17 Mar 2018 01:44
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 3685

Re: Clean text

I try solution from aGerman and works fine except first raw that always is: 2017-01-17 10:50:41 ..... 160045 1485635 aa_bb_cc_dd.pdf where 1485635 show size compressed archive we could parse name starting from "pdf" word, that's a constant, so we get name backwards when find a space or backslashes T...