Category : csv

I currently have the following code which works fine, but processing the file takes a long time, and if the file has more than about 8000 rows it will timeout. I want to be able to process the CSV file in the background so the user can leave or go to other pages while the ..

Read more

I have array of nested JSON objects (order details). I want to convert this to CSV using PHP. I will use this as csv template lately and I will use Laravel/PHP to import the csv and process the data. [ { "deliveryDetails": { "delivery_time": "1970-03-08T21:25", "instructions": "Veritatis exercitati", "phone": "123", "town": { "id": "1", "zone": ..

Read more

I’m trying to walk through as CSV file and extract all its contents. After the contents are imported I need to insert them into my mysql database table but before I can do that I need to check if these records exist. If a record does not, import this register. I’ve got headers and all ..

Read more

I have an object from a model, my object (retrive from AWS Athena database, just SQL query) …CoreObjectModelCardOrder, here is its structure: ^ …CoreObjectModelCardOrder {#2343 -orderId: "38496037-8709-4ac5-942f-01756a6843fc" -walletIdAttach: null -createWalletForEach: true -walletTypeId: 10 -userIdOwner: null -createUserForEach: true -number: 2 -defaultMccRestrictionGroupId: null -defaultMerchantRestrictionGroupId: null -defaultCountryRestrictionGroupId: null -defaultPermsGroup: "TRZ-CU-001" -status: "COMPLETE" -createdAt: "2021-07-27T17:39:00+02:00" -errors: [] -packageId: null ..

Read more

So in Laravel I have created my own custom command to search through products and filter them out depending on if they have a certain link in their overview and create a csv from them and I’ve thrown dd’s in place to try and figure out what section isn’t working but it doesn’t seem to ..

Read more

Here I am using Maatwebsite package of laravel to import data. Controller function: I am simply matching id from the database and adding data into it. public function import() { $data = Excel::toArray(new DescriptionImport, request()->file); if (!empty($data[0])) { foreach ($data[0] as $item) { $exists = Table_data::where(‘td_id’, $item[‘id’])->first(); if (empty($exists)) { Table_data::create($item); } else { $exists->description ..

Read more

I want to export CSV file in Laravel but it returns only text. $(document).on("click","#csvIcon",function(){ $(‘#mask’).css(‘display’,’block’); var fId=$(this).attr(‘data-formId’); $.get(‘/clientarea/form/responses/csv/export’, {‘formId’:fId}, function (data,status,xhr) { $(‘#mask’).css(‘display’,’none’); } ) }); route: Route::get(‘/clientarea/form/responses/csv/export’,[ResponsesController::class,’exportCsv’]); My controller: In the controller I have to array $data and $questions that fetched from database to create my csv content. public function exportCsv(Rrequest $request) … $data=[‘a’,’b’,’c’,’d’]; ..

Read more

I’ve been using laravel^5.8 and laravel-admin^1.8.6 on a project. I was implementing a feature to export bulk data to CSV. The total rows in the export could be more than 500k. Consequenty, I used laravel chunk method to avoid memory overflow, and sent a streamed response like this, class FundTransferChunkedExporter extends AbstractExporter { public function ..

Read more

I have a function where I generates excel (.csv) file. Everything is working except download. So my idea was to download the file automatically in the browser after generating the csv file. When the file was generated we store it in the public folder. So when I call my function , the function is opening ..

Read more

I’m creating a REST API with Lumen PHP, i want to create a tsv response to visualise genomic data. for example this is the JSON response: [ { "chrom":"3", "chromStart":"10120", "chromEnd":"10296", "exp_id":"GSE43985", "target":"ESR1", "biotype":"VCaP_E2", "score":"0", "strand":".", "summitStart":10187, "summitEnd":10188, "rgb":"224,168,84" }, { "chrom":"3", "chromStart":"10123", "chromEnd":"10285", "exp_id":"GSE98367", "target":"MAF", "biotype":"monocyte", "score":"5.03350", "strand":".", "summitStart":10253, "summitEnd":10254, "rgb":"168,112,28" } ] I ..

Read more

I’m trying to import an automatically generated csv into Google Sheets using this as cell value: =importData("https://example.com/reports/some-report") When I try importData on a static file on the server everything works as expected (like =importData("https://example.com/storage/some-static-report.csv") ) ..but when I generate the file on the fly () I get a #N/A in the cell; "Resource at url ..

Read more

I have a function like this and with cronjob it sends reporters csv file.But the issue is : public function exportNsaveServer($heading, $rows, $filename) { $path = ‘admin/exports/’ . Auth::user()->id; $this->makeDir($path); $storageBasePath = Storage::disk(‘public’)->getDriver()->getAdapter()->getPathPrefix(); $filename = rand() . ‘_’ . $filename; $path = $storageBasePath . ‘adminexports’ . Auth::user()->id . ” . $filename; $fullpath = ‘admin/exports/’ . ..

Read more

I have a function like this and with cronjob it sends reporters csv file.But the issue is : public function exportNsaveServer($heading, $rows, $filename) { $path = ‘admin/exports/’ . Auth::user()->id; $this->makeDir($path); $storageBasePath = Storage::disk(‘public’)->getDriver()->getAdapter()->getPathPrefix(); $filename = rand() . ‘_’ . $filename; $path = $storageBasePath . ‘adminexports’ . Auth::user()->id . ” . $filename; $fullpath = ‘admin/exports/’ . ..

Read more