Jump to content

format readfile with SRER


Deye
 Share

Go to solution Solved by Deye,

Recommended Posts

  • Solution

Hi,

$var = 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g4bs7dec.default\containers.json' _
         & @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g4bs7dec.default\datareporting\session-state.json' _
         & @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g2bs7sea.default\sessionCheckpoints.json' _
         & @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g2bs7sea.default\shield-preference-experiments.json'

for the first step  I need your take @  making the output look like this: not worried about empty lines in the output .etc .etc  for now

& @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g4bs7dec.default\containers.json' _
& @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g4bs7dec.default\datareporting\session-state.' _
& 'json' _
& @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g2bs7sea.default\sessionCheckpoints.json' _
& @LF & 'C:\Users\user\AppData\Roaming\Mozilla\Firefox\profiles\g2bs7sea.default\shield-preference-experiment' _
& 's.json' _

where lines greater than 100 notes  will split with just an ("&")  at new line feeds

and lines that are less than the above will  get at the  new line feed  ("& @LF &" ) 

Edit: Think I Just Got it with this try:

$str = StringRegExpReplace($var, '(.{1,100})', "& '$1' _" & @LF)
$str = StringRegExpReplace($str, "\_\n{2}\& ", "_" & @LF & "& @LF & $1")

Thanks

Edited by Deye
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...