Replace part of a vdf file Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionbash replace part of string based on locationHow to replace “&” with “&” except when already part of an XML entity?vi — replace chars from part of lineReplace part of filename by directory nameReplace values in fileLinux replace only user part in email patternreplace tab with spaceHow to find and replace multiple field values using jq?sh script to replace IP address from a file with one stored in a text filesed? - replace part of line if match from another file found

Take 2! Is this homebrew Lady of Pain warlock patron balanced?

What is this clumpy 20-30cm high yellow-flowered plant?

Do wooden building fires get hotter than 600°C?

Why is it faster to reheat something than it is to cook it?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

How would a mousetrap for use in space work?

How fail-safe is nr as stop bytes?

Performance gap between vector<bool> and array

Is CEO the "profession" with the most psychopaths?

How do living politicians protect their readily obtainable signatures from misuse?

Illegal assignment from sObject to Id

How does the math work when buying airline miles?

How to write this math term? with cases it isn't working

How much damage would a cupful of neutron star matter do to the Earth?

What would you call this weird metallic apparatus that allows you to lift people?

Is a ledger board required if the side of my house is wood?

Sum letters are not two different

Dating a Former Employee

What is the difference between globalisation and imperialism?

Using audio cues to encourage good posture

Can a new player join a group only when a new campaign starts?

Can anything be seen from the center of the Boötes void? How dark would it be?

Does the Weapon Master feat grant you a fighting style?

How often does castling occur in grandmaster games?



Replace part of a vdf file



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionbash replace part of string based on locationHow to replace “&” with “&amp;” except when already part of an XML entity?vi — replace chars from part of lineReplace part of filename by directory nameReplace values in fileLinux replace only user part in email patternreplace tab with spaceHow to find and replace multiple field values using jq?sh script to replace IP address from a file with one stored in a text filesed? - replace part of line if match from another file found



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Again I am attempting to alter configuration file via script.



I looked into jq but jq seems to support the .json format alone.



.vdf is almost exactly like .json except that there are no commas.



here is an attempt at what I want to do but with sed.



#!/bin/bash

text_to_find=' "9420"

"LastPlayed" ".*"
'
text_to_put=' "9420"

"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile


that returns: "sed: -e expression #1, char 13: unterminated `s' command"



and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.



here's an example of the test file :



https://pastebin.com/qFcEhTEf










share|improve this question
























  • it's not JSON. as specifically stated. it is VDF. so again not JSON

    – tatsu
    Apr 15 at 10:05

















1















Again I am attempting to alter configuration file via script.



I looked into jq but jq seems to support the .json format alone.



.vdf is almost exactly like .json except that there are no commas.



here is an attempt at what I want to do but with sed.



#!/bin/bash

text_to_find=' "9420"

"LastPlayed" ".*"
'
text_to_put=' "9420"

"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile


that returns: "sed: -e expression #1, char 13: unterminated `s' command"



and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.



here's an example of the test file :



https://pastebin.com/qFcEhTEf










share|improve this question
























  • it's not JSON. as specifically stated. it is VDF. so again not JSON

    – tatsu
    Apr 15 at 10:05













1












1








1








Again I am attempting to alter configuration file via script.



I looked into jq but jq seems to support the .json format alone.



.vdf is almost exactly like .json except that there are no commas.



here is an attempt at what I want to do but with sed.



#!/bin/bash

text_to_find=' "9420"

"LastPlayed" ".*"
'
text_to_put=' "9420"

"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile


that returns: "sed: -e expression #1, char 13: unterminated `s' command"



and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.



here's an example of the test file :



https://pastebin.com/qFcEhTEf










share|improve this question
















Again I am attempting to alter configuration file via script.



I looked into jq but jq seems to support the .json format alone.



.vdf is almost exactly like .json except that there are no commas.



here is an attempt at what I want to do but with sed.



#!/bin/bash

text_to_find=' "9420"

"LastPlayed" ".*"
'
text_to_put=' "9420"

"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile


that returns: "sed: -e expression #1, char 13: unterminated `s' command"



and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.



here's an example of the test file :



https://pastebin.com/qFcEhTEf







shell-script shell sed jq






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 14 at 15:15







tatsu

















asked Apr 14 at 15:00









tatsutatsu

1487




1487












  • it's not JSON. as specifically stated. it is VDF. so again not JSON

    – tatsu
    Apr 15 at 10:05

















  • it's not JSON. as specifically stated. it is VDF. so again not JSON

    – tatsu
    Apr 15 at 10:05
















it's not JSON. as specifically stated. it is VDF. so again not JSON

– tatsu
Apr 15 at 10:05





it's not JSON. as specifically stated. it is VDF. so again not JSON

– tatsu
Apr 15 at 10:05










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512427%2freplace-part-of-a-vdf-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512427%2freplace-part-of-a-vdf-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.